public class xiaozurenwu1 {
    public static void main(String[] args){
        String[] bookIds = {"BOOK1","BOOK2","BOOK3","BOOK4","BOOK5"};
        String[] bookNames = {"Java编程基础","数据结构与算法","Python入门","数据库原理","计算机网络"};
        boolean[] isBorrowed = {true,false,true,false,false};

        System.out.println("当前可借阅图书: ");
        int availableCount = 0;
        for (int i = 0; i < bookIds.length; i++){
            if (!isBorrowed[i]){
                System.out.println(bookIds[i] + ":" + bookNames[i]);
                availableCount++;
            }
        }
        System.out.println("可借阅图书总数: " + availableCount);
        String returnBookId = "Book1";
        for (int i = 0; i < bookIds.length; i++){
            if (bookIds[i].equals(returnBookId)){
                isBorrowed[i] = false;
                System.out.println("\n" + returnBookId + "已归还");
                break;
            }
        }
        availableCount = 0;
        for (boolean borrowed : isBorrowed){
            if (!borrowed) availableCount++;
        }
        System.out.println("归还后可借阅图书总数: " + availableCount);
    }
}
